package com.shaozi.nc.hibservice;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shaozi.data.hib.dao.BaseHibDao;
import com.shaozi.data.hib.service.BaseServiceImpl;
import com.shaozi.lib.throwable.SzException;
import com.shaozi.nc.data.hibVO.CrmPipelineVO;

@Service(value = "crmPipelineService")
public class CrmPipelineService extends BaseServiceImpl<CrmPipelineVO> {

	@Autowired
	public CrmPipelineService(BaseHibDao<CrmPipelineVO> baseHibDao) {
		super(baseHibDao);

	}

	
	public CrmPipelineVO findOne(int id) throws SzException {
		String hql = "from CrmPipelineVO where id=" + id;
		List<CrmPipelineVO> vos = getDao().getDaoSupport().queryObjects(hql, 0, 1);
		return vos.isEmpty() ? null : vos.get(0);
	}

}
